#include "form2.h"
#include "ui_form2.h"
#include <QPainter>
#include "man_can_100.h"
#include <QLabel>

Form2::Form2(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form2)
{
    ui->setupUi(this);
    s = 0;
    QString str("");
    display = str;
}

void Form2::paintEvent(QPaintEvent *event){
    QPainter painter(this);
    painter.setPen(Qt::red);
    painter.setBrush(Qt::red);
    QFont font("ink free",16);
    painter.setFont(font);
    painter.drawText(200,145,QString::number(s));
    painter.drawText(150,100,display);
}

Form2::~Form2()
{
    delete ui;
}

void Form2::on_pushButton_clicked()
{
    man_can_100 *g = new man_can_100;
    g->show();
    this->close();
}
